package com.liujit.standard.basis.core.exception;

import com.liujit.standard.basis.core.enums.ResultCode;
import lombok.Data;

/**
 * @description: 业务异常
 * @author: liujun
 * @create: 2020/12/31 4:30 下午
 **/
@Data
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 317908174414944380L;

    protected Integer code;

    protected String msg;

    public BusinessException(String msg) {
        this.code = ResultCode.FAILURE.code();
        this.msg = msg;
    }

    public BusinessException(ResultCode resultCode) {
        this.code = resultCode.code();
        this.msg = resultCode.msg();
    }

}
